約 6,614,599 件
https://w.atwiki.jp/y0sota/pages/31.html
ヘッダファイルの読み込みについて gcc がデフォルトで検索するヘッダファイルとライブラリの場所は、基本的に/usr/include (以下のコマンドで確認することが出来ます。gcc -print-search-dirs) この場所に置かれたヘッダファイルは、コンパイル時にパスを指定することなく、 ****.h で読み込める。 一方、この場所に置かれていないヘッダファイルを ****.h の形で読み込みたい場合には、コンパイル時に -Iオプションを用いて、 I/ヘッダファイルが含まれるディレクトリまでのフルパス と指定する必要がある。たとえば、openGLのヘッダファイルは /usr/local/NVIDIA_GPU_Computing_SDK/C/common/inc に置かれているので、openGLでヘッダファイル GL/glut.h を指定したければ、コンパイル時に I/usr/local/NVIDIA_GPU_Computing_SDK/C/common/inc を付ける必要がある。 Intel compiler を使う場合の注意点 環境変数 LC_ALL = C としておかないとコンパイル時にえらーが出る。 setenv LC_ALL C コンパイラオプション http //x68000.q-e-d.net/~68user/unix/pickup?gcc Linux上でのプログラム開発 http //www.tuat.ac.jp/~asiaprog/courses/oss/lesson01/ Windows上でのC++入門 http //keicode.com/winprimer/ 構造体の配列を引数として関数に渡す方法 http //hitorilife.com/struct.php void型変数の受け渡し Assume that you want to pass two arrays, one of doubles and one of integers. A quick but not very elegant solution is to use global variables. The simplest way to avoid using globals is to declare a structure as struct mydata{ double dar[XXX]; int iar[YYY]; }; where XXX and YYY denote the appropriate array sizes. Then, define a structure variable with struct mydata data; and fill it data.dar[0]=7.0; data.iar[0]=-17; Following this, call the appropriate LM routine passing it the address of data as the adata argument, e.g. ret=dlevmar_der(func, fjac, ..., (void *) data); Your func and fjac routines should interpret the supplied data using type casting struct mydata *dptr; dptr=(struct mydata *)adata; // adata is passed as void * オブジェクトの参照渡し http //wisdom.sakura.ne.jp/programming/cpp/cpp12.html フレンドクラス http //www.geocities.jp/ky_webid/cpp/language/022.html コピーコンストラクタ http //www.geocities.jp/ky_webid/cpp/language/016.html 内部クラス http //www.geocities.jp/ky_webid/cpp/language/030.html オブジェクト配列 http //ppwww.phys.sci.kobe-u.ac.jp/~akusumoto/program/detail.php?d=c/05-pointer/pointer_array Link http //www.sat.t.u-tokyo.ac.jp/~tetsuya/homeNew/research/Tips/cpp_for_researcher_1.htm N-body sample program http //www.cs.cmu.edu/~ph/859E/src/nbody/nbody.html
https://w.atwiki.jp/deadspace_3/pages/56.html
Rip Core Suspended Ripper Ripper Suspended Ripper シリーズおなじみ、近距離戦闘用回転鋸。 発射後一定時間目の前に滞空し続ける丸鋸を射出する。 滞空中にLT/L2トリガーを離したり敵の攻撃を受けたりすると刃が消えてしまうので注意。 敵の仰け反り耐性や侵攻速度、同時出現数が大幅に増加した今作では 敵の突進を止めにくい上に囲まれやすく、非常に扱いにくくなった。 従来通り一発ごとに与えられる累計ダメージが非常に多く燃費はトップクラスに高いのだが、 反撃を受けやすくなった影響でその利点を活かしきれない場面も多い。 一応途切れずに当てきることが出来れば無改造状態でも難易度インポッシブルのSuper Slasherを一発で倒せる。 また、刃を展開している時でもサブの武器やキネシスは使用可能。 メインで使うには途切れずに刃を当てられるようForce Gunでダウンさせたりステイシスを使う等のアシストが必須。 尚、こちらはHeavy Frameの物とカタログスペック上は全く同じだが、 こちらはリロードが速い・装弾数が少ないという点で違いがある。 Frame Tool + Tip Compact Frame + Rip Core + Default Tip Range Near Accuracy Medium DMG ■■■■■■ RLD ■■■■■■ CLP ■■■■■■■■■■■■■ SPD ■■■■■■■■■■■■■■■■■ Electrocution Module Upper時Lowerに装着可。 鋸から電撃を放射する。 特筆すべきは威力強化よりも痺れモーションが用意されている敵なら仰け反り耐性を無視して動きを確実に止められる点。 鋸の範囲外もカバーするのでFeeder等の横槍にも効果を発揮してくれる。 この電撃だけでも通常のSlasherなら一撃で倒せるほどの威力があるが、Lowerに他武器を付けて汎用性を取るかは迷う所。 Rotator Cuff Module Upper時Lowerに装着可。 鋸を90度回転可能にする。 眼前の鋸の攻撃範囲が縦一本というマゾ仕様になるため、有用性が疑われる一品。 Ripper 貫通する回転鋸を射出する武器。 前作までのセカンダリがこれに当たる。 威力は弾薬消費からするとかなり高め。 通常の中型ネクロモーフの手足なら確実に引き裂く威力はある。 どういうわけかリッパーの名はこちらが引き継ぐことに。 Frame Tool + Tip Compact Frame + Rip Core + Directed Ejection Field Range Mid Accuracy Medium DMG ■■■■■■■■■■■■ RLD ■■■■■■ CLP ■■■■■■■■■■■■ SPD ■■■■■■■■ Electrocution Module Upper時Lowerに装着可。 鋸から電撃を放射する。 Rivet GunやJavelin Gunと違い、貫通するという特性上敵に刺さらないため、非常に扱いにくい。 しかも電撃の発動地点が鋸の進行方向の先端なので地面にぶっさすと 地中にめり込み過ぎて地表の敵にほぼ当たらない… 壁や高さのある障害物にさしても角度によっては当たらなくなる始末 この電撃を頼みに地面に鋸を刺すぐらいならデフォルトチップで使うか、 弾薬効率で圧倒的に上回るRivet Gunを使うべきである。 Explosive Module Upper時Lowerに装着可。 鋸を爆発させる。 こちらも電撃と同じく、扱いにくい。 電撃同様に障害物にめり込み過ぎてまともに当たらない産廃兵器 一応壁刺しで設置武器として使うならJavelin Gunの杭よりも鋸の方が燃費がいいが… この武器に限らず、そもそものExplosive Moduleの燃費が劣悪過ぎるという欠点がある。 Rotator Cuff Module Upper時Lowerに装着可。 鋸を90度回転可能にする。 こちらは飛び道具という仕様上、回転にも意味が出てくる。 Plasma Cutterのように状況に合わせて敵の腕や触手をもぎ取るのにどうぞ。 PC版にて Suspended Ripper + Rotator Cuff Module をやたらCuffで回転させたらフリーズしました - 名無しさん 2013-02-25 16 08 01 名前
https://w.atwiki.jp/cohstatsjp/pages/305.html
Vehicle Schwimmwagen Type 128 Contents 1 Schwimmwagen Type 128 Veterancy 2Info 3Tactics 4Built From 4.1 Panzer Elite Headquarters 5Doctrinal Abilities 6Vehicle Abilities 6.1 Vehicle Cover Schwimmwagen Type 128 Health 90 Max Speed 7.5 Sight 55 Cost 165 Acceleration 14 Detection 30/10 Time 25 Deceleration 9 Hotkey W Population 1 Rotation 120 Target Type sdkfz_22x Upkeep 2.688 Crush Human False Critical Type supply_truck Crush Mode None Rear Damage Enabled true Schwimmwagen Type 128 Veterancy [Expand][Hide] Received Damage Received Accuracy Maximum Speed Maximum Health 0.9 0.9 1.15 1.15 8 Vet-Exp Received Damage Received Accuracy Maximum Speed Maximum Health 0.95 0.95 1.05 1.15 22 Vet-Exp Received Damage Received Accuracy Maximum Speed Maximum Health 0.95 0.95 1.05 1.15 38 Vet-Exp Info The Panzer Elite Schwimmwagen Type 128 (Not to be confused with the Type 166 for Wehrmacht) is an alternative unit introduced in Tales of Valor. It can be chosen to swap in place with the Kettenkrad. The Schwimmwagen Type 128 is identical to the Kettenkrad, with the exception of having different abilities and being able to travel through water terrain faster. Like the Kettenkrad, it can gain one of three abilities, depending on the doctrine chosen. Scorched Earth grants the Incendiary Trap ability, Luftwaffe grants the Mark Target ability, and Tank Destroyer grants the Mine Drop ability. Incendiary Traps are incendiary mines that can be laid quickly by the Schwimmwagen. It costs 15 munitions and is only triggered by enemy infantry. When it explodes, it creates a large area of flames that deal damage over time. The damage is statistically identical to a single Incendiary Mortar round. Mark Target reveals the target, even through the fog of war, and increases its received accuracy by x1.2, for a duration of 20 seconds. Mine Drop drops a normal mine, and it costs more munitions than normal (35 vs 25). Schwimmwagens of both varieties suffer less movement speed penalties when travelling through water terrain, as they have a 0.8 (80%) modifier compared to 0.3 (30%) for most vehicles. Tactics The Schwimmwagen Type 128, like the Kettenkrad, has no weapons and is used mainly for capturing points and reconnaissance. Incendiary Trap can be used as anti-infantry mines. Since they are incendiary-based, they should be placed in spots where enemy infantry is likely to stand around in. For example, near resource points, or the entrances of buildings, where the flames can spread out toward the garrison and still damage them. Mark Target has a very short 10 second cooldown time and should be used as much as possible if the Schwimmwagen is on reconnaissance duties. This ability is handy for tracking or killing units, including camouflaged ones like Snipers, as it makes it easier to find and destroy them with other units. While Mine Drop costs more munitions than normal, the Schwimmwagen can take advantage of its speed to find hot spots as needed, in addition to being able to lay down the mines very quickly. Built From Panzer Elite Headquarters [Expand][Hide] Health 1500 Target Type building Cost 500 Critical Type panel_building Time 61 Hotkey Effects Deploy Pioneers and escalate Battle Phases to call in additional Reinforcements. ?ESeeStructure Panzer Elite Headquartersfor details. Doctrinal Abilities Ability Mark Target Ability Schwimmwagen Mine Drop Ability Incendiary Trap Vehicle Abilities Vehicle Cover [Expand][Hide] Cost Activation always_on Duration _ Target tp_any Recharge 0 Hotkey Effects $0 no key ?ESeeAbility Vehicle Coverfor details. Retrieved from http //coh-stats.com/Vehicle Schwimmwagen_Type_128
https://w.atwiki.jp/reisiki/pages/34.html
stg/game/Scene0.h ver090130 #ifndef __STG_GAME_SCENE0_H__#define __STG_GAME_SCENE0_H__ #include windows.h #include d3d9.h #include d3dx9.h #include boost/smart_ptr.hpp #include "siki/Siki.h"#include "siki/d3d/Scene.h"#include "siki/d3d/CustomVertex.h" namespace stg{namespace game{ class Scene0 public siki d3d Scene{public Scene0(); ~Scene0(); virtual bool SetDevice(sharedptr IDirect3D9 d3dobj, sharedptr IDirect3DDevice9 device); virtual bool Update(); virtual bool Draw(sharedptr IDirect3D9 d3dobj, sharedptr IDirect3DDevice9 device); private siki d3d TransformedVertex *m_v; IDirect3DVertexBuffer9 *m_pvertex; boost shared_ptr IDirect3DVertexBuffer9 m_vertices;}; } // namespace game} // namespace stg #endif // __STG0_GAME_SCENE0_H__ stg/game/Scene0.cpp ver090130 #include "../StdAfx.h"#include boost/smart_ptr.hpp #include boost/signal.hpp #include "Scene0.h" namespace stg{namespace game{ Scene0 Scene0() siki d3d Scene(1), m_pvertex(0){ static siki d3d TransformedVertex v[4] = { {300.0f, 200.0f, 0.0f, 1.0f, 0xffffffff, 0.0f, 0.0f}, {300.0f, 300.0f, 0.0f, 1.0f, 0xffffffff, 0.0f, 1.0f}, {200.0f, 200.0f, 0.0f, 1.0f, 0xffffffff, 1.0f, 0.0f}, {200.0f, 300.0f, 0.0f, 1.0f, 0xffffffff, 1.0f, 1.0f} }; m_v = v;} Scene0 ~Scene0(){ } bool Scene0 SetDevice(sharedptr IDirect3D9 d3dobj, sharedptr IDirect3DDevice9 device){ siki d3d TransformedVertex v[4] = { {300.0f, 200.0f, 0.0f, 1.0f, 0xffffffff, 0.0f, 0.0f}, {300.0f, 300.0f, 0.0f, 1.0f, 0xffffffff, 0.0f, 1.0f}, {200.0f, 200.0f, 0.0f, 1.0f, 0xffffffff, 1.0f, 0.0f}, {200.0f, 300.0f, 0.0f, 1.0f, 0xffffffff, 1.0f, 1.0f} }; //IDirect3DVertexBuffer9* pVertex; HRESULT hr = device- CreateVertexBuffer( sizeof(siki d3d TransformedVertex)*4, D3DUSAGE_WRITEONLY, D3DFVF_TRANSFORMED, D3DPOOL_MANAGED, m_pvertex, NULL ); if(!SUCCEEDED(hr)){ return false; } //IDirect3DVertexBuffer9* pVertex; hr = device- CreateVertexBuffer( sizeof(siki d3d TransformedVertex)*4, D3DUSAGE_WRITEONLY, D3DFVF_TRANSFORMED, D3DPOOL_MANAGED, m_pvertex, NULL ); void *pData; hr = m_pvertex- Lock(0, sizeof(siki d3d TransformedVertex)*4, (void**) pData, 0); if(hr == D3D_OK){ memcpy(pData, v, sizeof(siki d3d TransformedVertex)*4); m_pvertex- Unlock(); } return true;} bool Scene0 Update(){ return true;} bool Scene0 Draw(sharedptr IDirect3D9 d3dobj, sharedptr IDirect3DDevice9 device){ device- SetStreamSource(0, m_pvertex, 0, sizeof(siki d3d TransformedVertex)); device- SetFVF(D3DFVF_TRANSFORMED); device- DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2); return true;} } // namespace game} // namespace stg [09/01/30 22 09][][編集]
https://w.atwiki.jp/miracle_mikuru/pages/67.html
・COMとしてDLLを作成 →VC6 →ATL COM AppWizard →DLL →MFCのサポートON →挿入 →ATLオブジェクトの新規作成 →シンプルオブジェクト →ショートネーム入力 →ClassView →挿入したATLオブジェクトのインターフェイス名を右クリック →メソッドの追加 →メソッド名入力 →パラメータ入力(引数) →追加したメソッドの実装を書く →コンパイル
https://w.atwiki.jp/akiwada/pages/56.html
Linode設定メモ Linode を使用して、Ubuntu8.04LTS + dekiwiki + Trac を設定したときの手順メモ 注意 原因は調査していないが、ホスト設定後 Trac = Dekiwiki の順でインストールすると動作しない。なので、必ず Dekiwiki = Trac の順でインストールすること Trac と dekiwiki をそれぞれ別のバーチャルホストで運用した 今回は特に、domain も別にするため、DNS も2つ設定した ホスト作成 Linode にログイン Linode Manager から my profile に入る Timezone を (GMT+9 Japan) に設定 Linode Manager から Dashboard に入り、Deploy a Linux Distribution から Linode Distribution Wizard を起動 Ubuntu 8.04 LTS を選択し、Select Disk Image Size, Select Swap, Password を設定し Create Profile を押す Dashboard から作成したイメージを boot する DNS設定 Linode Manager から DNS Manager に入る Add a new domain zone をクリック Domain を入力して、Continue... を押す SOA E-mail を入力して、Save を押す 初期値が設定されているので、MX Records, A/AAAA Records, CNAME Records を必要に応じて変更する MX Records の Edit から、Hostname を変更して、Save を押す Add a new A/AAAA Record から、Hostname と IP Address を入力して、Save を押す Add a new CNAME Record から、Hostname と Aliases to を入力して、Save を押す 最終的に以下のようになる ホスト名変更 例)FQDN ubuntu.mydomain.com、IP 123.123.123.123 PuTTY などで、作成した ホストにログイン 通常ホスト名は li57-77 のようになっており /etc/hostname に設定されていない vi /etc/hostname で、変更したいホスト名を書き込んで hostname -F /etc/hostname で、設定を反映させる。ここで一旦 logout して、再度 login すると、プロンプトが root@li57-77 ~# から root@ubuntu ~ # になり、変更結果が確認できる Hostsファイル編集 例)FQDN ubuntu.mydomain.com、IP 123.123.123.123 自ホストのIPと完全修飾名FQDNを Hostsファイル に書き込む vi /etc/hosts cat /etc/hosts 127.0.0.1 ubuntu.mydomain.com fire 127.0.0.1 localhost localhost.mydomain.com 123.123.123.123 ubuntu.mydomain.com ubuntu ... ホストの日本語化 GPG鍵とレポジトリを追加 apt-get install wget wget http //www.ubuntulinux.jp/sources.list.d/hardy.list -O /etc/apt/sources.list.d/ubuntu-ja.list apt-get update パッケージをアップグレード apt-get upgrade DekiWikiインストール Vortice dell evoluzione を参考にした レポジトリを追加 vi /etc/apt/sources.list 開いたファイルに以下を編集 # mindtouch deb http //repo.mindtouch.com xUbuntu_8.04/ apt-get update 推奨パッケージインストール apt-get install html2ps poppler-utils wv gs tidy links Dekiwikiインストール apt-get install dekiwiki Apache Virtual Host を設定 vi /etc/apache2/sites-available/dekiwiki 開いたファイルに以下を編集 NameVirtualHost * ... ServerName ubuntu.mydomain.com ServerAlias deki.mydomain.com ServerAdmin admin@mydomain.com ... DekiWikiサイトを有効化 a2ensite dekiwiki デフォルトサイトを無効化 a2dissite default (defaultの方は一旦無効化) Apacheを再起動 /etc/init.d/apache2 restart DekiWiki設定 以下にアクセスしてブラウザからさらに設定する。 http //deki.mydomain.com/config/index.php ブラウザからの設定終了後 cd /var/www/dekiwiki/config mkdir /etc/dekiwiki cp -p mindtouch.host.conf /etc/dekiwiki cp -p mindtouch.deki.startup.xml /etc/dekiwiki cp -p LocalSettings.php /var/www/dekiwiki/ /etc/init.d/dekiwiki start 以下にアクセスしてブラウザ動作確認 http //deki.mydomain.com/ セキュリティ対策として指示に従い config フォルダの設定ファイルを削除 デフォルトサイトを有効化 a2ensite default Apacheを再起動 /etc/init.d/apache2 restart TRACインストール TracをLinuxにインストール,Tracの基本的な設定 を参考にした 関連パッケージのインストール apt-get install trac libapache2-mod-python libapache2-svn python-setuptools unzip wget デフォルトTracパッケージの削除 apt-get --purge remove trac Genshiインストール easy_install -Z Genshi==0.5.1 Trac日本語版のインストール wget http //www.i-act.co.jp/project/products/downloads/Trac-0.11.2.1.ja1.zip unzip Trac-0.11.2.1.ja1.zip cd /Trac-0.11.2.1.ja1 python setup.py bdist_egg easy_install dist/Trac-0.11.2.1.ja1-py2.5.egg AccountManagerPluginのインストール easy_install http //trac-hacks.org/svn/accountmanagerplugin/trunk IniAdminPluginのインストール easy_install http //trac-hacks.org/svn/iniadminplugin/0.11 TracとSubversionに必要なディレクトリとファイルを以下の場所に作成 ファイル/ディレクトリ 役割 /var/trac Tracプロジェクト群を配置 /var/trac/htdigest Digest認証ファイル(TracとSubversionで使用) /var/svn Subversionリポジトリ群を配置 /var/cache/egg Tracプラグインの展開先 ディレクトリを作成 mkdir /var/trac /var/svn /var/cache/egg Apacheから読み書きできるように所有者をwww-dataユーザーにする chown -R www-data www-data /var/trac /var/svn /var/cache/egg Apacheの設定を追加 vi /etc/apache2/sites-available/trac 以下の内容を追加します Location /trac SetHandler mod_python PythonHandler trac.web.modpython_frontend PythonOption TracEnvParentDir /var/trac/ PythonOption TracUriRoot /trac SetEnv PYTHON_EGG_CACHE /var/cache/egg /Location LocationMatch /[^/]+/login AuthType Digest AuthName trac AuthUserFile /var/trac/htdigest Require valid-user /LocationMatch Location /svn DAV svn SVNParentPath /var/svn SVNListParentPath on AuthType Digest AuthName trac AuthUserFile /var/trac/htdigest Require valid-user /Location Digest認証ファイルを作成して,Tracの管理用のユーザーアカウントを登録 -u www-data htdigest -c /var/trac/htdigest trac admin Adding password for admin in realm trac.New password (パスワードを入力)Re-type new password (もう一度パスワードを入力) ApacheのDigest認証モジュールを有効化 a2enmod auth_digest Apacheの設定を有効化 a2ensite trac 設定内容の文法チェック source /etc/apache2/envvars source /etc/apache2/envvars apache2 -t Syntax OK Apacheを再起動 /etc/init.d/apache2 restart Tracの基本的な設定 TracをLinuxにインストール,Tracの基本的な設定 を参考にした プロジェクトの作成 Subversionリポジトリを作成 -u www-data svnadmin create /var/svn/sample Tracプロジェクトを作成 -u www-data trac-admin /var/trac/sample initenv Creating a new Trac environment at /var/trac/sample Trac will first ask a few questions about your environment in order to initialize and prepare the project database. Please enter the name of your project. This name will be used in page titles and descriptions. Project Name [My Project] (プロジェクト名を指定する。後から変更できるので何も入力せずにEnterを押す) Please specify the connection string for the database to use. By default, a local SQLite database is created in the environment directory. It is also possible to use an already existing PostgreSQL database (check the Trac documentation for the exact connection string syntax). Database connection string [sqlite db/trac.db] (データベースを指定する。通常はSQLiteを使うので何も入力せずにEnterを押す) Please specify the type of version control system, By default, it will be svn. If you don t want to use Trac with version control integration, choose the default here and don t specify a repository directory. in the next question. Repository type [svn] (リポジトリの種別を指定する。今回はSubversionを使うので何も入力せずにEnterを押す) Please specify the absolute path to the version control repository, or leave it blank to use Trac without a repository. You can also set the repository location later. Path to repository [/path/to/repos] /var/svn/sample (Subversionリポジトリを指定する。作成しておいたSubversionリポジトリの場所を指定する) Creating and Initializing Project (略) --------------------------------------------------------------------- Project environment for My Project created. You may now configure the environment by editing the file /var/trac/sample/conf/trac.ini If you d like to take this new project environment for a test drive, try running the Trac standalone web server `tracd` tracd --port 8000 /var/trac/sample Then point your browser to http //localhost 8000/sample. There you can also browse the documentation for your installed version of Trac, including information on further setup (such as deploying Trac to a real web server). The latest documentation can also always be found on the project website http //trac.edgewall.org/ Congratulations! 登録したユーザー(admin)にTRAC_ADMINパーミッションを付加 -u www-data trac-admin /var/trac/sample permission add admin TRAC_ADMIN Tracプラグインの使用を許可 -u www-data nano /var/trac/sample/conf/trac.ini 以下の内容を追記 [account-manager] hash_method = HtDigestHashMethod htdigest_realm = trac password_file = /var/trac/htdigest password_store = HtDigestStore [components] acct_mgr.* = enabled iniadmin.* = enabled Trac(Apache)に設定を読み込ませる /etc/init.d/apache2 reload Webブラウザで動作確認 http //ホスト名/trac/ (Tracプロジェクトが一覧で表示) http //ホスト名/trac/sample (Tracプロジェクトが表示) http //ホスト名/svn (Digest認証のダイアログが表示)
https://w.atwiki.jp/matchmove/pages/79.html
Object Tracking 訳者注) 本文のチュートリアルよりも動画のWEBチュートリアルの方がわかりやすいです。 WEBチュートリアルwww.ssontech.com/content/fridge.htmの解説は手動トラッキングを用いているが オートマチックトラッキングの結果(カメラトラッキング)からオブジェクトトラッキングにチェンジする方法がある。 こちらですwww.ssontech.com/content/chgtoobj.htm カメラモードでトラッキング解析済みデータ(カメラトラッキング)から shot→AddMovingObject shot→camera01 Edit→SelectAll CoordinateSystemPanelでcamera01→objectに変更 SolvePanelでRefine→Automaticにしてから×(cameraパス消える) (カメラパスを削除する時、オートマチックを選んで×しないと 元のカメラトラッキングデータが残ってしまう。 )で、Disabledに変更してからGO を押下 オブジェクトトラッキング状態でも座標位置は設定可能なので 最初のフレームで3次元座標を設定しておく。 (以下は3dsMAXの場合の手順) この座標位置はエクスポートしたMAXへ引き継がれる。 ただしオブジェクトを置く時はworldじゃなくobject表示で設置すること。 MAX側へ取り込むと今度はカメラが固定でオブジェクトが動いている状態なので 新たに作った自分のCGへ基点(object1)のアニメーションデータをコピーしてやる。 FILE→アニメーションの合成→ソースオブジェクト選択(コピー元)→右へドラッグして作成したポリゴンへ挿入→アニメーションの合成 ただし、MAX上でのモデリングや位置調整はカメラトラッキング状態の方が圧倒的に楽です。 なにしろ座標変わりませんから。 カメラトラッキング版で形状等を調整したモデリングを作成しておいて MAXからエクスポートしたオブジェクトをSynthEyes側へインポートして位置合わせして 再度オブジェクトトラッキングでMAX側へエクスポートするワークフローが賢いかもしれないですね。。。 ちなみに下記ではBOXオブジェクトを用いてマッチさせる方法を示しています。 www.ssontech.com/content/boxmatch.htm こんな感じのことができます。 http //www.youtube.com/watch?v=QzruWH2nsNA feature=channel_page http //www.youtube.com/watch?v=liQXhexIYRk feature=channel_page Here s how to do an object-tracking shot, using the example shotlazysue.avi, which shows a revolving kitchen storage tray spinning (called a Lazy Susan in the U.S. for some reason). This shot provides a number of educational opportunities. It can be tracked either automatically or under manual supervision, so both will be described. The basic point of object tracking is that the shot contains an object whose motion is to be determined so that effects can be added. The camera might also be moving; that motion might also be determined if possible, or the object s motion can be determined with respect to the moving camera, without concern for the camera s actual motion. The object being tracked must exhibit perspective effects during the shot. If the object occupies only a small portion of the image, this will be unlikely. A film or HD source will help provide enough accuracy for perspective shifts to be detected. For object-tracking, all the features being tracked must remain rigidly positioned with respect to one another. For example, if a head is to be tracked, feature points must be selected that are away from the mouth or eyes, which move with respect to one another. If the expression of a face is to be tracked for character animation, see the section onMotion Capture. Moving-object tracking is substantially simpler than motion capture, and requires only a single shot and no special on-set preparation during shooting. Automatic Tracking · Open the lazysue.avi shot, using the default settings. · On the Solver panel, set the camera s solving mode toDisabled. · On the Shot menu, selectAdd Moving Object. You will see the object at the origin as a diamond-shaped null object. · Switch to the Roto panel, with the camera viewport selected. · Scrub through the shot to familiarize yourself with it, then rewind back to the beginning. · Click the create-spline (magic wand) button on the Roto panel. · Click roughly in the center of the image to establish the center point. · Click counterclockwise about the moving region of the shot, inset somewhat from the stationary portion of the cabinetry and inset from the bottom edge of the tray. Right-click after the last point. [The shape is shown below.] · Click the create-spline (magic wand) button again to turn it off. · Double-click the vertices as necessary to change them to corners. · In the spline list on the Roto panel, select Spline1 and hit the delete key. · On the object setting underneath the spline list, change the object setting from Garbage to Object01. Your screen should look something like this · Go to the Feature Panel. · Change the Motion Profile toGentle Motion. · HitBlips all frames. · HitPeel All. · Go to the end of the shot. · Verify that the five dots on the flat floor of the lazy susan have associated trackers a green diamond on them. · If you need to add a tracker to a tracking mark, turn on the Peel button on the Feature panel. Scrub around to locate a long track on each untracked spot, then click on the small blip to convert it to a tracker. Turn off Peel mode when you are done. · Switch to the Coordinate System Panel. · Go to frame 65. · Change the tracker on the “floor” that is closest to the central axis to be the origin. · Set the front center floor tracker to be a Lock Point, locked to 10,0,0. · Set the front right tracker toXY Plane(or XZ plane for a Y-Up axis mode). · Switch to the Solver Panel. · Make sure the Constrain checkbox is off. · Hit Go!. · Go to theAfter Trackingsection, below. Supervised Tracking The shot is best tracked backwards the trackers can start from the easiest spots, and get tracked as long as possible into the more difficult portion at the beginning of the shot. Tracking backwards is suggested for features that are coming towards the camera, for example, shots from a vehicle. · Open the lazysue.avi shot, using the default settings. · On the Solver panel, set the camera s solving mode toDisabled. · On the shots menu, selectAdd Moving Object. You will see the object at the origin as a diamond-shaped null object. · On the Tracker panel, turn onCreate. The trackers will be associated with the moving object, not the camera. · Switch to the Camera viewport, to bring the image full frame. · Click theTo End button on the play bar. · Click the Playback direction button from to (backwards). · Create a tracker on one of the dots on the shelf. Decrease the tracker size to approximately 0.015, and increase the horizontal search size to 0.03. · Create a tracker on each spot on the shelf. Track each as far as possible back to the beginning of the shot. Use the tracker interior view to scroll through the frames and reposition as needed. As the spots go into the shadow, you can continue to track them, using the tracker gain spinner. When a tracker becomes untrackable, turn off Enable, and Lock the tracker. Right-click the spinner to reset it for the next tracker. · Continue adding trackers from the end of the shot roughly as follows · Begin tracking from the beginning, by rewinding, changing the playback direction to forward, then adding additional trackers. You will need to add these additional trackers to achieve coverage early in the shot, when the primary region of interest is still blocked by the large storage container. · Switch to the graph editor in graph mode, sort by error mode. Use the mouse to sweep through and select the different trackers. Or, select Sort by error on the main View menu, and use the up and down arrows on the keyboard to sequence through the trackers. Look for spikes in the tracker velocity curves (solid red and green). Switch back to the camera view as needed for remedial work. · Switch to the Coordinate System control panel and camera viewport, at the end of the shot. · Select the tracker at center back on the surface of the shelf; change it to anOriginlock. · Select the tracker a bottom left on the shelf, change it toLock Pointwith coordinate X=10. · Select the tracker at front right; change it to anOn XY Planelock (or On XZ if you use Y-axis up for Maya or Lightwave). · Switch to the Solver control Panel. · Switch to the Quad view; zoom back out on the Camera viewport. · Hit Go! After solving completes in a few seconds, hit OK. · Continue to theAfter Trackingsection, below. After Tracking · Switch to the 3-D Objects panel, with the Quad viewport layout selected. · Click theWorldbutton, changing it toObject. · Turn on the Magic Wand tool and select the Cone object. · In the top view, draw a cone in the top-right quadrant, just above and right of the diamond-shaped object marker. · Hint it can be easier to adjust the cone s position in the Perspective view, locked to the camera, withView/Local coordinate handlesturned on. · Scrub the timeline to see the inserted cone. In your animation package, a small amount of camera-mapped stand-in geometry would be used to make the large container occlude the inserted cone and reveal correctly as the shelf spins. · Advanced techniques useCoalesce TrackersandClean Up Trackers. Difficult Situations When an object occupies only a relatively small portion of the frame, there are few trackers, and/or the object is moving so that trackers get out of view often, object tracking can be difficult. You may wind up creating a situation where the mathematically best solution does not correspond to reality, but to some impossible tracker or camera configuration. It is an example of the old adage,“Garbage In, Garbage Out”(please don’t be offended, gentle reader). Goosing the Solver Small changes in the initial configuration may allow the solver to, essentially randomly, pick a more favorable solution. Be sure to use theSlow but surecheckbox and all the different possibilities of the Rough camera motion selection, both on the solver panel. Trying a variety of manually-selected seed frames is also suggested. Small changes in trackers, or adding additional trackers, especially those at different depths, may also be helpful in obtaining the desired solution. Inverting Perspective Sometimes, in a low-perspective object track, you may see a situation where the object model and motion seem almost correct, except that some things that are too far away are too close, and the object rotates the wrong way. This is a result of low/no/conflicting perspective information. If you cannot improve the trackers or convince the solver to arbitrarily pick a different solution, read on. TheInvert Perspectivescript on the Script menu will invert the object and hopefully allow you to recover from this situation quickly. It flips the solved trackers about their center of gravity, on the current frame, changes them to seed trackers (this will mess up any coordinate system), and changes the solving mode toFrom Seed Points. You can then re-solve the scene with this solution, and hopefully get an updated, and better, path and object points. You should then switch back to Refine mode for further tracking work! Using a 3-D Model You might also encounter situations where you have a 3-D model of the object to be tracked. If SynthEyes knows the 3-D coordinates of each tracker, or at least 6-10 of them, it will be much easier to get a successful 3-D track. You can import the 3-D model into SynthEyes, then use the Perspective window s Place mode to locate the seed point of each tracker on the mesh at the correct location. Turn on the Seed checkbox on for each, and switch to the From Seed Points solving mode on. If you have determined the 3-D coordinates of your tracker externally (such as from a survey or animation package), construct asmall text filecontaining the x, y, and z coordinates, followed by the tracker name. Use File/Import/Tracker Locations to set these coordinates as the seed locations, then use the From Seed Points solver option. If the tracker named doesn’t exist, it will be created (using the defaults from the Tracker Panel, if open), so you can import your particular points first, and track them second, if desired, though tracking first is usually easier. The seed points will help SynthEyes select the desired (though suboptimal) starting configuration. In extreme situations, you may want to lock the trackers to these coordinates, which can be achieved easily by setting all the imported trackers to Lock Points on the Coordinate System panel. To make this easy, all the affected trackers are selected after an Import/Tracker Locations operation.
https://w.atwiki.jp/procom/pages/7.html
Integer降順のComparator class DescendComparator T implements Comparator T { @Override public int compare(T o0, T o1) { return -((Integer)o0).compareTo((Integer)o1); } }
https://w.atwiki.jp/originalwitch/pages/474.html
Passive(パシヴァ) 傀儡の魔女、その性質は忘我 大衆の意思に呑まれて己自身を失い、自ら動くことも出来ず、くたりとした人形の姿でそこらへんに転がっている魔女。 結界を作ることさえ出来ないほどに無力。 だが真に恐ろしきは、どのような人間であっても彼女を操り人形として動かし真実のような嘘を世界に撒き散らすことが出来る点である。 その力は、使用者だけに都合のいい歪んだ世界を作り上げてしまう…。 そしてやがて使用者も、同じ呪いの人形として道端に転がることになる。 彼女を倒すためには、欲望に呑まれないようにしよう。 感染系の魔女。マザーの元舞葉は、人に自分の性質を注ぎ込む間わざと相手の傀儡になります。 人形にされた相手もまたマザーと同じように…… ねずみ算の恐怖。 マザーを倒したら他の全部も死にますが、使い魔扱いなので自立した場合…… 魔法少女時代 八重山 舞葉(やえやま まいは)
https://w.atwiki.jp/0x0b/pages/38.html
字句 7 字句について (Lexical Convention) ECMAScript プログラムのソーステキストは最初に、トークン、行終端子、コメントあるいは空白のいずれかである入力要素のシーケンスに変換される。ソーステキストは、次の入力要素としてできるだけ長い文字シーケンスを繰り返しとって、左から右へと走査される。 字句文法には 2 つの目標記号がある。 InputElementDiv 記号は、除法演算子 (/) また除法代入演算子 (/=) が許される構文的文法コンテキストで使用される。 InputElementRegExp 記号は他の構文的文法コンテキストで使用される。 NOTE 構文的な文法内に、除算および RegularExpressionLiteral の両方が構文的文法によって許されるコンテキストが存在する; だが、そういう場合字句文法は InputElementDiv 目標記号を使用するので、そのコンテキスト中でスラッシュ開始は正規表現リテラル開始とは認められない。代替手段として、一つは括弧で正規表現リテラルを囲んでよい。 Syntax InputElementDiv WhiteSpace LineTerminator Comment Token DivPunctuator InputElementRegExp WhiteSpace LineTerminator Comment Token RegularExpressionLiteral 7.1 Unicode 制御文字 (Unicode Format-Control Characters) フォーマット制御のための (マークアップ言語のような) 上位手順がないので、 Unicode 形式制御文字 (例 LEFT-TO-RIGHT MARK や RIGHT-TO-LEFT MARK のような、 Unicode 文字データベース (Unicode Character Database) における "Cf" カテゴリの文字) という制御コードでテキストの範囲のフォーマットを制御する。編集を容易にしまた表示するため、ソーステキスト内でのこれらの許可は有益である。 フォーマット制御文字は ECMAScript プログラムのソーステキストのどの場所に出現してもよい。これらの文字は、字句文法を適用する前にソーステキストから取り除かれる。文字列と正規表現リテラルの処理前にこれらの文字が取り除かれるので、文字列、正規表現内に Unicode 制御文字を入れるには Unicode エスケープシーケンス (セクション 7.6) を使用しなければならない。 7.2 空白 (White Space) 空白文字は、ソーステキストの可読性を向上させ、そしてトークン (不可分の字句単位) を互いに分離させるために使用され、それ以上の意味はない。空白は 2 つのトークンの間、また文字列の中に出現できる(リテラル文字列値の一部を形成する意味のある文字と考えられる)。だが、トークンの中に出現することは出来ない。 次の文字が空白と考えられる Code Point ValueNameFormal Name \u0009Tab TAB \u000BVertical Tab VT \u000CForm Feed FF \u0020Space SP \u00A0No-break space NBSP Other category "Zs"その他の Unicode "space separator" USP Syntax WhiteSpace TAB VT FF SP NBSP USP 7.3 行終端子 (Line Terminators) 空白文字のように、行終端子はソーステキストの可読性を向上させ、そしてトークン (不可分の字句単位) を互いに分離させるために使用される。しかし、空白文字とは違い、行終端子は構文的文法の振る舞いに影響を与える。一般に、行終端子は 2 のトークンの間に出現する。だが構文的文法によって隠される場所がある。行終端子はトークンの中に出現することは出来ない。 not even a string. 行終端子は自動セミコロン挿入の処理にも影響を与える (セクション 7.9)。 空白は 2 つのトークンの間、また文字列の中に出現できる(リテラル文字列値の一部を形成する意味のある文字と考えられる)。だが、トークンの中に出現することは出来ない。 次の文字が行終端子と考えられる Code Point ValueNameFormal Name \u000ALine Feed LF \u000DCarriage Return CR \u2028Line separator LS \u2029Paragraph separator PS Syntax LineTerminator LF CR LS PS 7.4 コメント (Comments) Description コメントは、 1 行または複数行になりうる。複数行のコメントはネストできない。 1 行コメントは LineTerminator 以外の任意の文字を含むことが可能であること、またトークンは常に可能な長さである一般規則により、 1 行コメントは常に、マーカー // からその行の終わりまでの全ての文字で構成される。しかし、行末の LineTerminator は 1 行コメントの内容とはみなされない; それは字句文法によって別々に認識され、構文文法の入力要素のストリームの一部となる。この点がとても重要である。というのは、これは 1 行コメントの有無が自動セミコロン挿入 (セクション 7.9) に影響を与えないということを暗に意味するからである。 コメントは空白のように振る舞い、捨てられるが、 MultiLineComment が行終端子文字を含む場合、構文文法による解析を目的としてコメント全体が LineTerminator と考えられる、 Syntax Comment MultiLineComment SingleLineComment MultiLineComment /* MultiLineCommentCharsopt */ MultiLineCommentChars MultiLineNotAsteriskChar MultiLineCommentCharsopt PostAsteriskCommentCharsopt PostAsteriskCommentChars MultiLineNotForwardSlashOrAsteriskChar MultiLineCommentCharsopt PostAsteriskCommentCharsopt MultiLineNotAsteriskChar SourceCharacter but not asterisk * MultiLineNotForwardSlashOrAsteriskChar SourceCharacter but not forward-slash / or asterisk * SingleLineComment SingleLineCommentChars SingleLineCommentChar SingleLineCommentCharsopt SingleLineCommentChar SourceCharacter but not LineTerminator 7.5 トークン (Tokens) Syntax Token ReservedWord Identifier Punctuator NumericLiteral StringLiteral 7.5.1 予約語 (Reserved Words) Description 予約語を識別子として使うことはできない。 Syntax ReservedWord Keyword FutureReservedWord NullLiteral BooleanLiteral 7.5.2 キーワード (Keywords) 次のトークンは ECMAScript キーワードであり、 ECMAScript プログラム中で識別子に使うことはできない。 Syntax Keyword one of break case catch continue default delete do else finally for function if in instanceof new return switch this throw try typeof var void while with 7.5.3 将来の予約語 (Future Reserved Words) 次の語は提出された拡張の中でキーワードとして使用され、その拡張が将来採択される可能性を考え、予約される。 Syntax FutureReservedWord one of abstract boolean byte char class const debugger double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile 7.6 識別子 (Identifiers) Description 識別子は、若干の修正を加えた Unicode 標準 (バージョン 3.0 のセクション 5.16) で与えられる文法に従い解釈される。文法は Unicode 標準により指定される文字カテゴリの規範、及び参考情報の両方に基づいている。 Unicode 標準のバージョン 2.1 に指定されるカテゴリの文字は、全ての適合 ECMAScript 実装によってそれらのカテゴリ内として扱われなければならない; しかしながら、適合 ECMAScript 実装は、 Unicode の後のバージョンでのカテゴリ割り当てに基づく追加の合法的な識別子文字を許可してよい。 この標準は Unicode 標準に与えられる文法からある変更を指定する; ドル記号($) 及びアンダースコア (_) は識別子中のどこでも許される。ドル記号は機械的に生成されるコード中のみの使用を意図される。 Unicode エスケープシーケンスは識別子中でも許され、それは UnicodeEscapeSequence (セクション 7.8.4) の CV により算出されるように、識別子中のその場所に一文字を寄与する。 UnicodeEscapeSequence を使って識別子に不正な文字を設定することはできない。言い換えれば、\ UnicodeEscapeSequence シーケンスが UnicodeEscapeSequence の CV に置換されたら、結果は依然として有効な識別子で、正確に元の Identifier と文字の同じシーケンスなければならない。 Unicode 標準に従い規準的に等価である 2 つの識別子は、コードポイントの厳密に同じシーケンスによって表されない限りは等しくない(言い換えれば、適合 ECMAScript 実装は、識別子上でビット比較を行うことのみを要求される)。入ってくるソーステキストがコンパイラに行く前に正規化形式 C に変換されることを意図する。 Syntax Identifier ReservedWord でない IdentifierName IdentifierName IdentifierStart IdentifierName IdentifierPart IdentifierStart UnicodeLetter $ _ \ UnicodeEscapeSequence IdentifierPart IdentifierStart UnicodeCombiningMark UnicodeDigit UnicodeConnectorPunctuation \ UnicodeEscapeSequence UnicodeLetter Unicode カテゴリ "Uppercase letter (Lu)", "Lowercase letter (Ll)", "Titlecase letter (Lt)", "Modifier letter (Lm)", "Other letter (Lo)", "Letter number (Nl)" 内の任意の文字 UnicodeCombiningMark Unicode カテゴリ "Non-spacing mark (Mn)" または "Combining spacing mark (Mc)" 内の任意の文字 UnicodeDigit Unicode カテゴリ "Decimal number (Nd)" 内の任意の文字 UnicodeConnectorPunctuation Unicode カテゴリ "Connector punctuation (Pc)" 内の任意の文字 UnicodeEscapeSequence セクション 7.8.4 を参照。 HexDigit one of 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F 7.7 区切り子 (Punctuators) Syntax Punctuator one of { } ( ) [ ] . ; , = = == != === !== + - * % ++ -- | ^ ! ~ || ? = += -= *= %= = = = = |= ^= DivPunctuator one of / /= 7.8 リテラル (Literals) Syntax Literal NullLiteral BooleanLiteral NumericLiteral StringLiteral 7.8.1 Null リテラル (Null Literals) Syntax NullLiteral null Semantics null リテラルの値 null は、単独の Null 型の値で null と呼ばれる。 7.8.2 Boolean リテラル (Boolean Literals) Syntax BooleanLiteral true false Semantics Boolean リテラルの値 true は、 Boolean 型の値で true と呼ばれる。 Boolean リテラルの値 false は、Boolean 型の値で false と呼ばれる。 7.8.3 数値リテラル (Numeric Literals) Syntax NumericLiteral DecimalLiteral HexIntegerLiteral DecimalLiteral DecimalIntegerLiteral . DecimalDigitsopt ExponentPartopt . DecimalDigits ExponentPartopt DecimalIntegerLiteral ExponentPartopt DecimalIntegerLiteral 0 NonZeroDigit DecimalDigitsopt DecimalDigits DecimalDigit DecimalDigits DecimalDigit DecimalDigit one of 0 1 2 3 4 5 6 7 8 9 NonZeroDigit one of 1 2 3 4 5 6 7 8 9 ExponentPart ExponentIndicator SignedInteger ExponentIndicator one of e E SignedInteger DecimalDigits DecimalDigits DecimalDigits HexIntegerLiteral 0x HexDigit 0X HexDigit HexIntegerLiteral HexDigit NumericLiteral に直接続くソース文字は、けして IdentifierStart や DecimalDegit ではない。 NOTE 例えば 3in はエラーであり、 3 と in の 2 つの入力要素とはならない。 Semantics 数値リテラルは、 Number 型の値を表す。この値は 2 ステップで判断される まず、数学値 (MV) がリテラルから派生する; 次に、この数学値が、下に述べるように丸められる。 NumericLiteral DecimalLiteral の数学値は、 DecimalLiteral の数学値である。 NumericLiteral HexIntegerLiteral の数学値は、 HexIntegerLiteral の数学値である。 DecimalLiteral DecimalIntegerLiteral . の数学値は、 DecimalIntegerLiteral の数学値である。 DecimalLiteral DecimalIntegerLiteral . DecimalDigits の数学値は、 n を DecimalDigits の文字数として、 DecimalIntegerLiteral の数学値 + (DecimalDigits の数学値 × 10-n) である。 DecimalLiteral DecimalIntegerLiteral . ExponentPart の数学値は、 e を ExponentPart の数学値として DecimalIntegerLiteral の数学値 × 10e である。 DecimalLiteral DecimalIntegerLiteral . DecimalDigits ExponentPart の数学値は、 n を DecimalDigit の文字数、 e を ExponenetPart の数学値として、 (DecimalIntegerLiteral の数学値 + (DecimalDigits の数学値 × 10-n)) × 10e である。 DecimalLiteral . DecimalDigits の数学値は、 n を DecimalDigits の文字数として、 DecimalDigits の数学値 × 10-n である。 DecimalLiteral . DecimalDigits ExponentPart の数学値は、 n を DecimalDigits の文字数、 e を ExponenetPart の数学値として、 DecimalDigits の数学値の 10e-n である。 DecimalLiteral DecimalIntegerLiteral の数学値は、 DecimalIntegerLiteral の数学値である。 DecimalLiteral DecimalIntegerLiteral ExponentPart の数学値は、 e を ExponenetPart の数学値として、 DecimalIntegerLiteral の数学値 × 10e である。 DecimalIntegerLiteral 0 の数学値は、 0 である。 DecimalIntegerLiteral NonZeroDigit DecimalDigits の数学値は、 n を DecimalDigits の文字数として、 (NonZeroDigit の数学値の × 10n) + DecimalDigits の数学値である。 DecimalDigits DecimalDigit の数学値は、 DecimalDigit の数学値である。 DecimalDigits DecimalDigits DecimalDigit の数学値は、 (DecimalDigits の数学値 × 10) + DecimalDigit の数学値である。 ExponentPart ExponentIndicator SignedInteger の数学値は、 SignedInteger の数学値である。 SignedInteger DecimalDigits の数学値は、 DecimalDigits の数学値である。 SignedInteger + DecimalDigits の数学値は、 DecimalDigits の数学値である。 SignedInteger - DecimalDigits の数学値は、負の DecimalDigits の数学値である。 DecimalDigit 0 または HexDigit 0 の数学値は、 0 である。 DecimalDigit 1 または NonZeroDigit 1 または HexDigit 1 の数学値は、 1 である。 DecimalDigit 2 または NonZeroDigit 2 または HexDigit 2 の数学値は、 2 である。 DecimalDigit 3 または NonZeroDigit 3 または HexDigit 3 の数学値は、 3 である。 DecimalDigit 4 または NonZeroDigit 4 または HexDigit 4 の数学値は、 4 である。 DecimalDigit 5 または NonZeroDigit 5 または HexDigit 5 の数学値は、 5 である。 DecimalDigit 6 または NonZeroDigit 6 または HexDigit 6 の数学値は、 6 である。 DecimalDigit 7 または NonZeroDigit 7 または HexDigit 7 の数学値は、 7 である。 DecimalDigit 8 または NonZeroDigit 8 または HexDigit 8 の数学値は、 8 である。 DecimalDigit 9 または NonZeroDigit 9 または HexDigit 9 の数学値は、 9 である。 HexDigit a または HexDigit A の数学値は、 10 である。 HexDigit b または HexDigit B の数学値は、 11 である。 HexDigit c または HexDigit C の数学値は、 12 である。 HexDigit d または HexDigit D の数学値は、 13 である。 HexDigit e または HexDigit E の数学値は、 14 である。 HexDigit f または HexDigit F の数学値は、 15 である。 HexIntegerLiteral 0x HexDigit の数学値は、 HexDigit の数学値である。 HexIntegerLiteral 0X HexDigit の数学値は、 HexDigit の数学値である。 HexIntegerLiteral HexIntegerLiteral HexDigit の数学値は、 (HexIntegerLiteral の数学値 × 16) + HexDigit の数学値である。 一旦数値リテラルの厳密な数学値が決定されたら、 Number 型の値に丸められる。数学値が 0 ならば、丸められる値は +0 である; そうではなく、リテラルが DecimalLiteral でなくそのリテラルが 20 を超える有効数字数\でなければ、数値が 20 番目以降の各有効数字を数字 0 へ置換して生成されるリテラルの数学値の数値、または 20 番目以降の各有効数字を数字 0 に置換して生成されるリテラルの数学値の数値、そして 20 番目の有効数字の位置のリテラルの増加、のいずれかでありえる場合、丸められる値は (セクション 8.5 で定義される意味の) 数学値の数値でなければならない。数字はそれが ExponentPart の一部\でなく次の二点のどちらかであれば有効数字 (significant) である。 0 でない。 その左側が 0 以外の数字でその右側が 0 以外の数字で ExponentPart 内でない。 7.8.4 文字列リテラル (String Literals) 文字列リテラルは、単引用符または二重引用符で囲まれた 0 個以上の文字である。各文字はエスケープシーケンスによって表されてもよい。 Syntax StringLiteral " DoubleStringCharactersopt " SingleStringCharactersopt DoubleStringCharacters DoubleStringCharacter DoubleStringCharactersopt SingleStringCharacters SingleStringCharacter SingleStringCharactersopt DoubleStringCharacter SourceCharacter but not double-quote " or backslash \ or LineTerminator \ EscapeSequence SingleStringCharacter SourceCharacter but not single-quote or backslash \ or LineTerminator \ EscapeSequence EscapeSequence CharacterEscapeSequence 0 [lookahead ∉ DecimalDigit] HexEscapeSequence UnicodeEscapeSequence CharacterEscapeSequence SingleEscapeCharacter NonEscapeCharacter SingleEscapeCharacter one of " \ b f n r t v NonEscapeCharacter SourceCharacter but not EscapeCharacter or LineTerminator EscapeCharacter SingleEscapeCharacter DecimalDigit x u HexEscapeSequence x HexDigit HexDigit UnicodeEscapeSequence u HexDigit HexDigit HexDigit HexDigit 非終端記号 HexDigit の定義は、セクション 7.8.3 に与える。 SourceCharacter はセクション 2 及び 6 で述べる。 文字列リテラルは String 型の値を表す。リテラルの文字列値 (SV) は、文字列値の様々な部分に寄与する文字値 (CV) に関して記述される。この処理の一部として、文字列リテラル内部のいくつかの文字は、セクション 7.8.3 に述べる数学値 (MV) を持つものとして解釈される。 StringLiteral "" の文字列値は、空の文字シーケンスである。 StringLiteral の文字列値は、空の文字シーケンスである。 StringLiteral " DoubleStringCharacters " の文字列値は、DoubleStringCharacters の文字列値である。 StringLiteral SingleStringCharacters の文字列値は、SingleStringCharacters の文字列値である。 DoubleStringCharacters DoubleStringCharacter の文字列値は、1 文字のシーケンスで、 DoubleStringCharacter の文字値である。 DoubleStringCharacters DoubleStringCharacter DoubleStringCharacters の文字列値は、順に DoubleStringCharacters の文字列値内の全ての文字の続く DoubleStringCharacter の文字値のシーケンスである。 SingleStringCharacters SingleStringCharacter の文字列値は、1 文字のシーケンスで、 SingleStringCharacter の文字値である。 SingleStringCharacters SingleStringCharacter SingleStringCharacters の文字列値は、順に SingleStringCharacters の文字列値内の全ての文字の続く SingleStringCharacter の文字値のシーケンスである。 DoubleStringCharacter SourceCharacter but not 二重引用符 " or バックスラッシュ \ or LineTerminator の文字値は、 SourceCharacter 文字それ自身である。 DoubleStringCharacter \ EscapeSequence の文字値は、 EscapeSequence の文字値である。 SingleStringCharacter SourceCharacter but not 単引用符 or バッククラッシュ \ or LineTerminator の文字値は、 SourceCharacter 文字それ自身である。 SingleStringCharacter \ EscapeSequence の文字値は、 EscapeSequence の文字値である。 EscapeSequence CharacterEscapeSequence の文字値は、 CharacterEscapeSequence の文字値である。 EscapeSequence 0 [lookahead ∉ DecimalDigit] の文字値は、 NUL 文字 (Unicode 値 0000) である。 EscapeSequence HexEscapeSequence の文字値は、 HexEscapeSequence の文字値である。 EscapeSequence UnicodeEscapeSequence の文字値は、 UnicodeEscapeSequence の文字値である。 CharacterEscapeSequence SingleEscapeCharacter の文字値は、次の表に従い SingleEscapeCharacter に決定されるコードポイント値の文字である Escape SequenceCode Point ValueNameSymbol \b\u0008backspace BS \t\u0009horizontal tab HT \n\u000Aline feed (new line) LF \v\u000Bvertical tab VT \f\u000Cform feed FF \r\u000Dcarriage return CR \"\u0022double quote" \ \u0027single quote \\\u005Cbackslash\ CharacterEscapeSequence NonEscapeCharacter の文字値は、 NonEscapeCharacter の文字値である。 NonEscapeCharacter SourceCharacter but not EscapeCharacter or LineTerminator の文字値は、 SourceCharacter 文字それ自身である。 HexEscapeSequence x HexDigit HexDigit の文字値は、コードポイント値が (16 × 最初の HexDigit の数学値) + 2番目の HexDigit の数学値 である文字である。 UnicodeEscapeSequence u HexDigit HexDigit HexDigit HexDigit の文字値は、コードポイント値が (4096 (すなわち 163) × 最初の HexDigit の数学値) + (256 (すなわち 162) × 2 番目の HexDigit の数学値) + (16 × 3 番目の HexDigit の数学値) + 4 番目の HexDigit の数学値 である文字である。 NOTE 文字 LineTerminator は、それにバックスラッシュ \ を先行させても、文字列リテラル内には出現できない。 行終端子文字を文字列リテラルの文字列地の一部に置く妥当な方法は、 \n や \u000A のようなエスケープシーケンスを用いることである。 7.8.5 正規表現リテラル (Regular Expression Literals) 正規表現リテラルは走査時に RegExp オブジェクト (セクション 15.10) に変換される入力要素である。オブジェクトはそれを含むプログラムまた関数の評価の開始前に生成される。リテラル評価はそのオブジェクトへの参照を生成する; それは新規オブジェクト生成はしない。プログラム内の 2 つの正規表現リテラルは、2 つのリテラルの内容がまったく同じであっても、互いに === として比較しない正規表現オブジェクトに評価する。 RegExp オブジェクトは、 new RegExp (セクション 15.10.4) や関数としての RegExp コンストラクタ呼出し (セクション 15.10.3) によって実行時に生成されてもよい。 下の生成規則は正規表現リテラルの構文を記述し、正規表現リテラルの終了の検出に入力要素走査から使用される。 RegularExpressionBody 及び RegularExpressionFlags を構成する文字の文字列は、それ自身がより厳重な文法でそれらを解釈する正規表現コンストラクタに、未解釈で渡される。実装は正規表現コンストラクタの文法を拡張してよいが、 RegularExpressionBody 及び RegularExpressionFlags 生成規則、またはこれらの生成規則によって使用される生成規則を拡張すべきではない。 Syntax RegularExpressionLiteral / RegularExpressionBody / RegularExpressionFlags RegularExpressionBody RegularExpressionFirstChar RegularExpressionChars RegularExpressionChars [empty] RegularExpressionChars RegularExpressionChar RegularExpressionFirstChar NonTerminator but not * or \ or / BackslashSequence RegularExpressionChar NonTerminator but not \ or / BackslashSequence BackslashSequence \ NonTerminator NonTerminator SourceCharacter but not LineTerminator RegularExpressionFlags [empty] RegularExpressionFlags IdentifierPart NOTE 正規表現リテラルは空にはならない; 空の正規表現リテラルをあらわす代わりに、文字 // は 1 行コメントを開始する。空の正規表現を指定するには、 /(? )/ を用いる。 Semantics 正規表現リテラルは Object 型の値を表す。この値は 2 ステップで決定される まず、正規表現の RegularExpressionBody 及び RegularExpressionFlags 生成規則拡張を構成する文字が、それぞれ 2 つの文字列の Pattern と Flags に解析されずに集められる。そして new RegExp コンストラクタが 2 つの引数 Pattern と Flags で呼出され、結果は RegularExpressionLiteral の値となる。 new RegExp 呼出しがエラーを生成するならば、実装は、自由裁量で、プログラム走査中に直ちにエラー報告してもよいし、プログラム実行中に正規表現リテラルが評価されるまでエラーを延期してもよい。 7.9 自動セミコロン挿入 (Automatic Semicolon Insertion) ある種の ECMAScript 文 (空文 (empty statement), 変数文 (variable statement), 式文 (expression statement), do-while 文 (do-while statement), continue 文 (continue statement), break 文 (break statement), return 文 (return statement), turhow 文 (throw statement)) はセミコロンで終了しなければならない。そのようなセミコロンは、ソーステキスト内に常に明示的に出現してよい。しかしながら、簡単にするために、ある位置ではソーステキストからセミコロンを省略してよい。この位置は、それらの位置のソースコードトークンのストリームにセミコロンが自動的に挿入されるという言葉で説明される。 7.9.1 自動セミコロン挿入規則 (Rules of Automatic Semicolon Insertion) プログラムが左から右へと解析され、文法の任意の生成規則によって許可されないトークン (違反トークン (offending token) と呼ばれる) に遭遇するとき、次の条件に 1 つ以上当てはまる場合、違反トークンの前にセミコロンが自動的に挿入される。 1. 違反トークンが、少なくとも 1 つの LineTerminator で、前のトークンから分離されている。 2. 違反トークンが、 } である。 プログラムが左から右へと解析され、トークンの入力ストリームが終了し、解析器が入力トークンストリームを一つの完全な ECMAScript Program として解析できないとき、入力ストリームの末尾にセミコロンが自動的に挿入される。 プログラムが左から右へと解析され、文法の任意の生成規則によって許可されないトークンに遭遇するが、その生成規則が限定生成規則 (resutricted production) であり、限定生成規則内部\で注記 "[no LineTerminator here]" にすぐ続く終端記号または非終端記号の最初のトークン (そのためこのようなトークンは限定トークン (restricted token) と呼ばれる) であり、そして限定トークンが少なくとも 1 つの LineTerminator で前のトークンから分離されているとき、限定トークンの前にセミコロンが自動的に挿入される。 とはいえ、以上の規則を上書きする条件を追加する セミコロンが結果として空文として解析される場合、またセミコロンが for 文 (セクション 12.6.3) のヘッダ内の 2 つのセミコロンの一つになる場合は、セミコロンは自動的に挿入されない。 NOTE 文法における限定生成規則は下記のみである PostfixExpression LeftHandSideExpression [LineTerminator 無し] ++ LeftHandSideExpression [LineTerminator 無し] -- ContinueStatement continue [LineTerminator 無し] Identifieropt ; BreakStatement break [LineTerminator 無し] Identifieropt ; ReturnStatement return [LineTerminator 無し] Expressionopt ; ThrowStatement throw [LineTerminator 無し] Expression ; これらの限定生成規則の実際の効果は、次のとおりである 解析器がそれを後置演算子として扱う場所に ++, -- トークンが出現し、少なくとも一つ以上の LineTerminator が前のトークンと ++, -- トークンの間に出現するとき, セミコロンが ++, -- トークンの前に自動的に挿入される。 continue, break, return, throw トークンが出現し、次のトークンの前に LineTerminator が出現するとき、セミコロンは continue, break, return, throw トークンの後に自動的に挿入される。 ECMAScript プログラマへの結果的な実用的助言は 後置 ++ 演算子、また後置 -- 演算子は、項と同じ行に出現するべきである。 return 文、また throw 文中の Expression は、return トークンまた throw トークンと同じ行で開始するべきである。 break 文、また continue 文のラベルは、 break トークンまた continue トークンと同じ行にあるべきである。 7.9.2 自動セミコロン挿入例 (Examples of Automatic Semicolon Insertion) 次のソース { 1 2 } 3 は、ECMAScript 文法において、自動セミコロン挿入規則を以ってしても有効な文ではない。 対照的に、このソース { 1 2 } 3 もまた有効な ECMAScript 文ではないが、自動セミコロン挿入によって次のように変換される { 1 ;2 ;} 3; これは有効な ECMAScript 文である。 ソース for (a; b ) は有効な ECMAScript 文ではなく、自動セミコロン挿入によって変更されない。セミコロンが for 文のヘッダに要求されるからである。自動セミコロン挿入が for 文のヘッダ内の 2 つのセミコロンの 1 つを挿入することはない。 ソース return a + b は自動セミコロン挿入によって次のように変換される return; a + b; NOTE 式 a + b は、 return 文によって返される値として扱われない。return トークンから LineTerminator で分離されているからである。 ソース a = b c は自動セミコロン挿入によって次のように変換される a = b; c; NOTE トークン ++ は、変数 b に適用される後置演算子として扱われない。 b と ++ の間に LineTerminator があるからである。 ソース if (a b) else c = d は有効な ECMAScript 文ではなく、その位置に適用する文法の生成規則がないとしても、 else トークンの前への自動セミコロン挿入によって変更されない。自動セミコロン挿入が空文として解析されるからである。 ソース a = b + c (d + e).print() は自動セミコロン挿入によって変換されない。 2 行目の括弧式 () は関数呼び出しの引数リストとして解釈できるからである。 a = b + c(d + e).print() 代入文が左括弧で開始しなければならない状況では、自動セミコロン挿入を信頼するより、先行する文の末尾に明示的なセミコロンを提供する方が、プログラマにとってよい発想である。